package task18;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test03 {

    private void AltC(String a, String b){
        int index = 0;
        FileInputStream fs = null;
        FileOutputStream fis = null;
        try {
            fs = new FileInputStream(a);
            fis = new FileOutputStream(b);
            index = fs.available();
            byte [] bytes = new byte[index];
            fs.read(bytes);
            fis.write(bytes);


        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if(fs != null && fis != null){
                try {
                    fs.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) {
        Test03 test03 = new Test03();
        test03.AltC("src/1.txt","src/2.txt");
    }
}
